package a2;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class Course {private String name;
    private Building building; // 确保课程在某个建筑中进行

    public Course(String name, Building building) {
        this.name = name;
        this.building = Objects.requireNonNull(building, "Building cannot be null");
    }

    public String getName() {
        return name;
    }

    public Building getBuilding() {
        return building;
    }

    @Override
    public String toString() {
        return "Course{" +
                "name='" + name + '\'' +
                ", building=" + building +
                '}';
    }
}
